import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index/index'
// import inRenda from '@/components/index/inRenda'
// import inDetail from '@/components/index/inDetail'
import inEmail from '@/components/index/inEmail'
// import inEpeople from '@/components/index/inEpeople'
import inHot from '@/components/index/inHot'
// import inMember from '@/components/index/inMember'
// import inNews from '@/components/index/inNews'
import articledetail from '@/components/article/articledetail'
import articlelist from '@/components/article/articlelist'
import chat from '@/components/emenber/chat'
import message from '@/components/emenber/message'
import index2 from '@/components/index2/index2'
import index3 from '@/components/index3/index3'
import question from '@/components/index3/question'
import index3list from '@/components/index3/index3list'
import index3detail from '@/components/index3/index3detail'
import slanmu from '@/components/index3/slanmu'
import forum from '@/components/emenber/forum'
import bottom from '@/components/emenber/bottom'
import myforum from '@/components/emenber/myforum'
import setforum from '@/components/emenber/setforum'
import forumdetail from '@/components/emenber/forumdetail'


Vue.use(Router)

const router = new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: index,
			meta: { title: "掌上新开铺" }
    },
		// {
		// 	path: '/index/inRenda',
		// 	name: 'inRenda',
		// 	component: inRenda,
		// },
		// {
		// 	path: '/index/inDetail',
		// 	name: 'inDetail',
		// 	component: inDetail,
		// },
		// {
		// 	path: '/index/inNews',
		// 	name: 'inNews',
		// 	component: inNews,
		// },
		{
			path: '/index/inEmail',
			name: 'inEmail',
			component: inEmail,
			meta: { title: "廉政信箱" }
		},
		{
			path: '/index/inHot',
			name: 'inHot',
			component: inHot,
		},
		// {
		// 	path: '/index/inMember',
		// 	name: 'inMember',
		// 	component: inMember,
		// },
		{
			path: '/article/articleDetail',
			name: 'articledetail',
			component: articledetail,
		},
		{
			path: '/article/articlelist',
			name: 'articlelist',
			component: articlelist
		},
		{
			path: '/emenber/chat',
			name: 'chat',
			component: chat,
			meta: { title: "交流互动" }
		},
		{
			path: '/emenber/message',
			name: 'message',
			component: message,
			meta: { title: "留言" }
		},
		{
			path: '/index2/index2',
			name: 'index2',
			component: index2,
			meta: { title: "办事大厅" }
		},
		{
			path: '/index3/index3',
			name: 'index3',
			component: index3,
			meta: { title: "魅力社区" }
		},
		{
			path: '/index3/slanmu',
			name: 'slanmu',
			component: slanmu
		},
		{
			path: '/index3/question',
			name: 'question',
			component: question
		},
		{
			path: '/index3/index3list',
			name: 'index3list',
			component: index3list
		},
		{
			path: '/index3/index3detail',
			name: 'index3detail',
			component: index3detail
		},
		{
			path: '/emenber/forum',
			name: 'forum',
			component: forum,
			meta: { title: "留言" }
		},
		{
			path: '/emenber/bottom',
			name: 'bottom',
			component: bottom
		},
		{
			path: '/emenber/myforum',
			name: 'myforum',
			component: myforum
		},
		{
			path: '/emenber/setforum',
			name: 'setforum',
			component: setforum
		},
		{
			path: '/emenber/forumdetail',
			name: 'forumdetail',
			component: forumdetail
		}
  ]
})

router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})

export default router